package com.clannad.eduservice.controller.Front;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.clannad.commonutils.R;
import com.clannad.eduservice.entity.EduCourse;
import com.clannad.eduservice.entity.EduTeacher;
import com.clannad.eduservice.service.EduCourseService;
import com.clannad.eduservice.service.EduTeacherService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/eduservice/indexfront")
@CrossOrigin
public class IndexFrontController {

    @Autowired
    EduCourseService eduCourseService;

    @Autowired
    EduTeacherService eduTeacherService;

    @GetMapping("index")
    public R index(){
        List<EduTeacher> list1 = eduTeacherService.getTeacherIndex();


        List<EduCourse> list = eduCourseService.getCourseIndex();

        return R.ok().data("teacherList",list1).data("eduList",list);
    }
}
